<?php
include         '../data/company_profile_dal.php';
include_once    '../entity/company_profile_entity.php';

class CompanyProfileMng
{
    function update($companyProfileEntity)
    {
        $companyProfileDAL = new CompanyProfileDAL();
        return $companyProfileDAL->update($mysqli, $companyProfileEntity->id, $companyProfileEntity->active, $companyProfileEntity->membership, $companyProfileEntity->categoryID, $companyProfileEntity->marketID, $companyProfileEntity->process,
                                    $companyProfileEntity->address1, $companyProfileEntity->address2, $companyProfileEntity->address3, $companyProfileEntity->address4, $companyProfileEntity->supplierID, $companyProfileEntity->inTime, $companyProfileEntity->inUser);
    }

    function get($id)
    {
        $companyProfileDAL = new CompanyProfileDAL();
        if ($result = $companyProfileDAL->get($where)) {
            $row = $result->fetch_assoc();
            $companyProfileEntity = new CompanyProfileEntity();
            foreach ($row as $key => $value) {
                $companyProfileEntity->$key = $value;
            }
            return $companyProfileEntity;
        } else {
            return false;
        }
    }

    function getAll()
    {

    }

    function delete($mysqli, $id)
    {
        $companyProfileDAL = new UserDAL();
       return $companyProfileDAL->delete($mysqli, $id);
    }
}

?>
